<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../css/layout.css" rel="stylesheet" type="text/css" />
<smart>include file ='../head.config.html'</smart>
<script language="javascript" type="text/javascript" src="../js/select_area_zh-cn.js"></script>
<script language="JavaScript" type="text/javascript" src="../js/jquery/jquery.validate.js"></script>
<script>
function checkCode(){
	var   myForm=document.forms['mainform'];
	document.getElementById('Submit').disabled = true;
	$.get("product.php",{action:"check_code",checkcode:$('#checkcode').val()},function(data){if(data == '1'){myForm.action='product.php?action=order';myForm.method='POST';myForm.submit(); }else{alert('验证码错误');document.getElementById('Submit').disabled = false;return false;}})
	return false;
}
</script>
<smart>include file ='../../../js/validate/product_buy.html'</smart>
</head>
<body>
<div id="container760" style="width:760px"> <smart>include file ='../header.html'</smart>
  <div id="buy_top"></div>
  <table class="table_buy">
    <tr>
      <th><h1>确认宝贝价格与交易条件</h1></th>
    </tr>
    <tr>
      <!-- 没图的时候屏蔽 start -->
      <td><img src="../<smart> $p_pic </smart>" class="p_pic140">
        <ul id="buy_info">
          <li>宝贝名称：　<a href="product.php?action=view&pid=<smart> $p_code </smart>"><smart> $p_name </smart></a></li>
          <li>当前价格：　<span class="priceText"><smart> $buy_price </smart></span> 元</li>
          <li>付款方式：　<span class="font_orange">支付宝</span></li>
          <li>所 在 地：　<smart> $p_region </smart></li>
          <li>卖家： <A href="../store/userinfo.php?userid=<smart> $member_id </smart>" target=_blank><smart> $seller_nick </smart></A></li>
        </ul></td>
      <!-- 没图的时候屏蔽 end -->
    </tr>
  </table>
  <form name="mainform" id="mainform" action="product.php?action=order" method="post" onsubmit="return checkCode();">
    <table class="table_buy">
      <tr>
        <th><h1>确认您的收货地址</h1></th>
      </tr>
      <tr>
        <td colspan="2"><script language="javascript" type="text/javascript">
        var noAddress = false;
</script>
          <script language="javascript" type="text/javascript">
          <smart> section name=i loop=$receive_array </smart>
          var addr_<smart> $receive_array[i].receive_code </smart> = "<smart> $receive_array[i].province </smart>^^^<smart> $receive_array[i].city </smart>^^^<smart> $receive_array[i].address </smart>";
          var province_<smart> $receive_array[i].receive_code </smart> = "<smart> $receive_array[i].province </smart>";
          var city_<smart> $receive_array[i].receive_code </smart> = "<smart> $receive_array[i].city </smart>";
          var postCode_<smart> $receive_array[i].receive_code </smart> = "<smart> $receive_array[i].zip </smart>";
          var fullName_<smart> $receive_array[i].receive_code </smart> = "<smart> $receive_array[i].receive_name </smart>";
          var phone_<smart> $receive_array[i].receive_code </smart> = "<smart> $receive_array[i].phone </smart>";
          var mobile_<smart> $receive_array[i].receive_code </smart> = "<smart> $receive_array[i].mobilephone </smart>";
          var addrDetail_<smart> $receive_array[i].receive_code </smart> = "<smart> $receive_array[i].address </smart>";
          <smart> /section </smart>
</script>
          <ul id="receive_info">
            <input type="hidden" name="checkaddr" id="checkaddr" value="<smart> $receive_array[0].receive_code </smart>" />
            <smart> section name=i loop=$receive_array </smart>
            <li>
            <smart> if $smarty.section.i.iteration == "1" </smart><smart> /if </smart>
              <input type="radio" name="daddr" value="<smart> $receive_array[i].receive_code </smart>" onclick="putAddr('<smart> $receive_array[i].receive_code </smart>')" id="add<smart> $receive_array[i].receive_code </smart>"<smart> if $smarty.section.i.iteration == "1" </smart> checked <smart> /if </smart> />
              <label for="add<smart> $receive_array[i].receive_code </smart>"> 省(市)：<smart> $receive_array[i].province </smart> 市(区)：<smart> $receive_array[i].city </smart> <smart> $receive_array[i].province </smart><smart> $receive_array[i].city </smart><smart> $receive_array[i].address </smart> (收货人：<smart> $receive_array[i].receive_name </smart>)</label>
            </li>
            <smart> /section </smart>
            <input type="hidden" name="deliver_address_empty" value="1">
          </ul></td>
      </tr>
      <tr>
        <td colspan="2" align="center" style="padding-top:15px;"><script language="javascript">
        if (!noAddress) {
        	document.write('<a href="javascript:void showEdit();">使用其他地址</a>&nbsp;&nbsp;&nbsp;&nbsp;');
        }
        var hasError = false;
    </script>
          <script language="javascript">
          var IE5plus = navigator.userAgent.indexOf('MSIE 6') != -1 || navigator.userAgent.indexOf('MSIE 5') != -1;
          function ie6fix() {
          	if (!IE5plus) return;
          	document.getElementById('_edit_address').style.display = '';
          	document.getElementById('_edit_address').style.display = 'none';
          }

          function putAddr(id) {
          	var addr = eval('addrDetail_' + id);
          	var post = eval('postCode_' + id);
          	var name = eval('fullName_' + id);
          	var phone = eval('phone_' + id);
          	var mobile = eval('mobile_' + id);
          	var province = eval('province_' + id);
          	var city = eval('city_' + id);
          	document.mainform['txtAddress'].value = addr;
          	document.mainform['txtZip'].value = post;
          	document.mainform['txtReceiveName'].value = name;
          	document.mainform['txtPhone'].value = phone;
          	document.mainform['txtMobilephone'].value = mobile;
          	document.getElementById('checkaddr').value=document.getElementById('add' + id).value;

          	selectprovince = province;
          	selectcity = city;

          	iniProvince(document.getElementById('slProvince'));
          	iniCity(document.getElementById('slProvince'),document.getElementById('slCity'));

          	try {
          		if (!_show) ie6fix();
          	}catch (e) {
          		if (!_show) ie6fix();
          	}


          }
          var _show = false;
          function showEdit(forceOpen) {
          	document.getElementById('checkaddr').value="";
          	var obj = document.getElementById('_edit_address');
          	if (obj == null) {
          		return;
          	}
          	if (_show && !forceOpen) {
          		_show = false;
          		obj.style.display = 'none';
          	}else {
          		_show = true;
          		obj.style.display = '';
          	}
          }
        	   </script>
          <a href="../member/own_receive.php" target="_blank">管理我的收货地址</a> </td>
      </tr>
      <tr>
        <td colspan="2"><br />
          <table id="_edit_address" style="display:none;">
            <tr>
              <td align="right">省：</td>
              <td><select name="txtProvince" id="slProvince" onchange="javascript:iniCity(document.getElementById('slProvince'),document.getElementById('slCity'));">
                </select>
                &nbsp;市：
                <select name="txtCity" id="slCity">
                </select>
                <script language="javascript">
                //ifshowcode=1;
                //selectprovince = "<smart> $product_array.p_province </smart>";
                //selectcity = "<smart> $product_array.p_city </smart>";

                iniProvince(document.getElementById('slProvince'));
                iniCity(document.getElementById('slProvince'),document.getElementById('slCity'));
</script>
              </td>
            </tr>
            <tr>
              <td align="right" valign="top">街道地址：</td>
              <td><textarea name="txtAddress" style="width:400px;height:36px"></textarea>
                <br />
                <span class="G">此处不需要再填写省市区，否则会重复显示。</span> <br />
              </td>
            </tr>
            <tr>
              <td align="right">邮政编码：</td>
              <td><input type="text" name="txtZip" size="10" value=""></td>
            </tr>
            <tr>
              <td align="right">收货人姓名：</td>
              <td><input type="text" name="txtReceiveName" size="12" value=""></td>
            </tr>
            <tr>
              <td align="right">电话(选填)：</td>
              <td><input type="text" name="txtPhone" size="20" value=""></td>
            </tr>
            <tr>
              <td align="right">手机(选填)：</td>
              <td><input type="text" name="txtMobilephone" size="20" value=""></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td><span class="G">电话和手机是为了方便快递公司联系收货人。</span></td>
            </tr>
          </table>
          <div></div></td>
      </tr>
    </table>
    <br>
    <table>
      <tr>
        <td height="2" bgcolor="99CCFF" scope="col"></td>
      </tr>
      <tr>
        <td bgcolor="#EEEEEE" height="24"><span class="CB">　隐私</span></td>
      </tr>
    </table>
    <table>
      <tr>
        <td height="30" class="fontSize14"><div>
            <input type="hidden" name="anony_enabled" value="aa">
            <p>
              <input type="checkbox" name="anonymous" value="1" >
              隐藏我的名字<span class="G">（选择后，您对该宝贝的出价、留言和评价都将匿名。）</span> </p>
            <br>
          </div>
          <div style="font-size:12px;margin-top:15px;" class="G LL" align="center"></div></td>
      </tr>
    </table>
    <table>
      <tr>
        <td height="2" bgcolor="99CCFF" scope="col"></td>
      </tr>
      <tr>
        <td bgcolor="#EEEEEE" height="24" class="CB">&nbsp;
          确认购买数量 </td>
      </tr>
    </table>
    <br>
    <input type=hidden name="event_submit_do_buy" value="1">
    <input type=hidden name="txtPname" value="<smart> $p_name </smart>">
    <input type=hidden name="txtPcode" value="<smart> $p_code </smart>">
    <input type=hidden name="txtPcid" value="<smart> $pc_id </smart>">
    <input type=hidden name="txtSellerId" value="<smart> $member_id </smart>">
    <input type=hidden name="sell_type" value="<smart> $sell_type </smart>">
    <input type=hidden name="photo_url" value="<smart> $p_pic </smart>">
    <input type=hidden name="seller_nickname" value="<smart> $seller_nick </smart>">
    <input type=hidden name="seller_rate_sum" value="0">
    <input type=hidden name="seller_rank" value="0">
    <input type=hidden name="who_pay_ship" value="<smart> $p_transfee_charge </smart>">
    <input type=hidden name="allow_quantity" id="allow_quantity" value="<smart> $p_storage-$p_sold_num </smart>">
    <input type=hidden name="group_mincount" value="<smart> $p_group_mincount </smart>">
    <input type=hidden name="secure_pay" value="true">
    <input type=hidden name="have_sold" value="<smart> $p_sold_num </smart>">
    <input type=hidden name="region" value="<smart> $p_region </smart>">
    <input type=hidden name="step_price" value="<smart> $step_price </smart>">
    <table>
      <tr>
        <td><table>
            <tr>
              <td> 购买数量： </td>
              <td align="left"><input type="hidden" name="txtUnitPrice" value="<smart> $buy_price </smart>" size="10">
                <input type="text" id="txtBuyNum" name="txtBuyNum" value="1" size="5" />
                （可购 <smart> $p_storage-$p_sold_num </smart> 件） <label style="display:none" for="txtBuyNum" class="wrong" metaDone="true" generated="true"></label></td>
            </tr>
            <smart> if $sell_type == "0" </smart>
            <input type=hidden name="p_storage" value="<smart> $p_storage </smart>">
            <input type=hidden name="buy_price" value="<smart> $buy_price </smart>">
            <tr>
              <td> 出价金额： </td>
              <td align="left">
                <input type="text" id="txtPayPrice" name="txtPayPrice" value="" size="5" />
                （请输入您的出价，至少<smart> $min_price </smart> 元）<label style="display:none" for="txtPayPrice" class="wrong" metaDone="true" generated="true"></label> <input type=hidden name="min_price" id="min_price" value="<smart> $min_price </smart>"></td>
            </tr>
            <smart> /if </smart>
            <tr>
              <td>运送方式：</td>
              <td align="left"><div id="postageDiv"></div>
                <input type="hidden" id="shippingHidden" name="_fma.b._0.s" value="" />
                <smart> if $p_transfee_charge == "1" </smart>
                <input type="radio" name="txtTfFee" value="<smart> $tf_py </smart>" />
                平邮:<smart> $tf_py </smart>
                <input type="radio" name="txtTfFee" value="<smart> $tf_kd </smart>" />
                快递:<smart> $tf_kd </smart>
                <input type="radio" name="txtTfFee" value="<smart> $tf_ems </smart>" />
                EMS:<smart> $tf_ems </smart>
                <div class="G">如果没有运费发生，您可以在拍下该宝贝后，要求卖家修改运费</div>
                <smart> else </smart> <smart> $p_transfee_charge </smart> <smart> /if </smart> </td>
            </tr>
            <tr>
              <td colspan="2"></td>
            </tr>
            <tr>
              <td class="fontSize14" style="padding-bottom:28px;"> 检验代码： </td>
              <td><input type=text name="checkcode" id="checkcode" value="" size="5"/>
                <img id="checkCodeImg" src="../operation/code.php" onclick="this.src='../operation/code.php?' + Math.random()"  align="absmiddle"><a href="#" onclick="document.getElementById('checkCodeImg').src='../operation/code.php?' + Math.random()">看不清楚，再换一张</a><br/>
                <div class="G" style="margin-top:10px;">请将图片上的数字或字母准确抄写到左侧文本框中</div></td>
            </tr>
            <table>
              <tbody>
                <tr>
                  <td colspan="2"></td>
                </tr>
                <tr>
                  <td style="padding-bottom: 15px;" class="fontSize14">给卖家留言：<br/>
                    &nbsp;(可不填)</td>
                  <td><textarea rows="2" cols="70" name="leaveword" style="height:40px"></textarea>
                    <div class="G">可以告诉卖家您对商品的特殊要求，如：颜色、尺码等</div></td>
                </tr>
              </tbody>
            </table>
          </table>
          <center>
            <input type="submit" name="Submit" id="Submit" value="确认无误，购买">
          </center>
          <div style="font-size:12px;margin-top:15px;" class="G LL" align="center">点击按钮表示您将确认购买并同意支付货款 <br>
            您可在确认后选择支付宝方式安全付款 </div></td>
      </tr>
    </table>
  </form>
  <smart>include file ='../footer.html'</smart> </div>
</body>
</html>
